package com.example.lin.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 林志豪
 * @since 2024-02-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sys_department")
@ApiModel(value = "Department对象", description = "")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("部门ID")
    @TableId(value = "department_id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("部门名称")
    @TableField(value = "department_name")
    private String name;

    @ApiModelProperty("部门电话")
    @TableField(value = "department_phone")
    private String phone;

    @ApiModelProperty("部门地址")
    @TableField(value = "department_address")
    private String address;

    @ApiModelProperty("部门编码")
    @TableField(value = "department_code")
    private String code;

    @ApiModelProperty("部门简介")
    @TableField(value = "department_description")
    private String description;

    @ApiModelProperty("父级部门ID")
    @TableField(value = "parent_id")
    private Integer pid;

    @ApiModelProperty("子部门列表")
    @TableField(exist = false)
    private List<Department> children;

    @ApiModelProperty("是否展开")
    @TableField(exist = false)
    private boolean opened = false;

    @ApiModelProperty("是否排序")
    private Integer orderBy;

    @ApiModelProperty("是否删除(0-未删除，1-已删除)")
    private Integer deleted;
}
